<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    <!--
    age = prompt("请输入你的年龄:","20");
    if (age != null){
        alert("你今年" + age +"岁了!");
    }else{
        alert("你按了[取消]按钮");
    }
    //-->
</script>
</body>
</html>